/**
 * 自定义函数
 * */


var formList = {
    data: [],
    pages: {start: 0, limit: 10}
}; //数据列表


//列表
function getIndex(){
    var formData = {
        aid: getAid(),
        tmpId: tmpId,
        pageStart: formList.pages.start,
        pageLimit: formList.pages.limit
    };
    console.log(formData);
    $.ajax({
        type: apis.tmp1History.method,
        url: domain + apis.tmp1History.url,
        data: formData,
        success: function (res) {
            console.log(res);
            if (res.code != 0) {
                if (formList.pages.start > 0) {
                    msgPop({msg: res.msg});
                }
                return
            }
            for (var i = 0; i < res.data.length; i ++) {
                formList.data.push(res.data[i]);
            }
            formList.pages.start ++;
            getHtml();
        },
        error: function () {
            console.log('网络错误');
        }
    });
}


//列表字符串
function getHtml(){
    var h = '', i, d = formList.data;
    var id = 0;
    h += '';
    for (i = 0; i < d.length; i ++) {
        id = d[i].id;
        h += '<tr class="text-c">';
        h += '<td>' + id + '</td>';
        h += '<td>' + d[i].title + '</td>';
        h += '<td><div style="width: 100%; max-height: 100px; overflow-y: auto;">' + d[i].content + '</div></td>';
        h += '<td>' + d[i].addtime + '</td>';
        h += '</tr>';
    }
    h += '';
    $('#formList').html(h);
    $('#tableMore').show();
}